import Vue from "vue";
import Vuex from "vuex";
import { GetItem, SetItem } from "../utils/storage";

Vue.use(Vuex);
const Token_Key = "Token";
export default new Vuex.Store({
  state: {
    user: GetItem("Token_Key"),
    Fpath: GetItem("fuji"),
    Zpath: GetItem("ziji"),
  },
  mutations: {
    setUser(state, data) {
      state.user = data;
      SetItem("Token_Key", state.user);
    },
    getFpath(state, data) {
      state.Fpath = JSON.parse(data);
      SetItem("fuji", state.Fpath);
    },
    getZpath(state, data) {
      state.Zpath = JSON.parse(data);
      SetItem("Tokezijin_Key", state.Zpath);
    },
  },
  actions: {},
  modules: {},
});
